var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("AssetsManager"),
    i = e("RoleSoldierInfo"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.skill_name = null),
                (t.skill_info = null),
                (t.skill_cooling_time = null),
                (t.skill_node = null),
                (t.hero_skill_info = null),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.getSkillInfo = function (e) {
                (this.hero_skill_info = i.default.Hore_Skill_Info[e]),
                    (this.skill_node.children[0].getComponent(cc.Sprite).spriteFrame = a.default
                        .getInstance()
                        .getHeroSkilIcon(i.default.Role_info[e].C_ID + "01")),
                    (this.skill_node.children[1].getComponent(cc.Sprite).spriteFrame = a.default
                        .getInstance()
                        .getHeroSkilIcon(i.default.Role_info[e].C_ID + "02")),
                    this.showSkillInfo(1);
            }),
            (t.prototype.OnClick = function (t) {
                switch ((e.prototype.OnClick.call(this, t), t.node.name)) {
                    case "skill_one":
                        this.showSkillInfo(1);
                        break;
                    case "skill_two":
                        this.showSkillInfo(2);
                }
            }),
            (t.prototype.showSkillInfo = function (e) {
                (this.skill_name.string = 1 == e ? this.hero_skill_info.one_name : this.hero_skill_info.two_name),
                    (this.skill_info.string = 1 == e ? this.hero_skill_info.one_info : this.hero_skill_info.two_info),
                    (this.skill_cooling_time.string =
                        (1 == e ? this.hero_skill_info.one_time : this.hero_skill_info.two_time) + "秒"),
                    (this.skill_node.children[0].children[0].active = 1 == e),
                    (this.skill_node.children[1].children[0].active = 2 == e);
            }),
            __decorate([l(cc.Label)], t.prototype, "skill_name", void 0),
            __decorate([l(cc.Label)], t.prototype, "skill_info", void 0),
            __decorate([l(cc.Label)], t.prototype, "skill_cooling_time", void 0),
            __decorate([l(cc.Node)], t.prototype, "skill_node", void 0),
            __decorate([s], t)
        );
    })(n.default);
o.default = c;
